Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

270
Vistas
Using contentWindow.postMessage to control YouTube videos embedded in iframe--where can I find a list of "func"?

I'm new to front-end development so maybe this is a stupid question. I'm trying to write a program to control YouTube videos embedded using vanilla JavaScript. I found an example in this Control YouTube video with vanilla javascript link. I noticed the author uses contentWindow.postMessage() to send the command to the iframe.

For example, to play the YouTube video, the code is something like

div.getElementsByTagName("iframe")[0].contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');

Where can I find a complete list of "func" (e.g. "playVideo")? I googled using keywords like "postMessage", "iframe", "playVideo", etc but couldn't find any documentation that answers my question.

I want to be able to control the YouTube video more precisely. In addition to playing/pausing the video, I want to be able to skip to a certain timestamp, control the volume, or even output only the left or right sound channel.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda